Skip to content

Visual blocks: start at their final height (no shrinking) - #17

Merged
cedricvogel-leo merged 1 commit into
mainfrom
fix/visual-start-height
Oct 25, 2026
Merged

cedricvogel-leo merged 1 commit into
mainfrom
fix/visual-start-height

Conversation

@cedricvogel-leo

Copy link
Copy Markdown
Collaborator

Visualization-only blocks (@GLPython.visual, profiles «anschauen» and «demo») visibly changed height when they appeared, e.g. when a quiz's solution opens.

Why. The iframe started at 420px. Until its trace arrives, the embed reports only its loading state (160px, raised to the 170px minimum), and then its content. So the start height alone couldn't fix it: even at 200px the iframe would first dip to 170px.

Change

  • In visual mode the start height is also the lower limit: 190px, or with large the requested visualizer height (60% of the window, as before).
  • eval and turtle blocks keep the 170px minimum.
  • largeVisualizerHeight is computed once and also passed to the embed as before.

Measured in the hosted LiaScript player (every height the iframe takes, from the moment it appears):

Block main this branch
visual, x = 3 * (4 + 5) 420 → 170 → 188px 190px (no change at all)
visual large 420 → 170 → 592px 540 → 592px (only grows, by the step bar)

A taller visualization (e.g. with a function or output) grows from 190px to its height once, without shrinking first. node scripts/check-macro.mjs passes.

🤖 Generated with Claude Code

A visualization-only iframe started at 420px, shrank to 170px while the
embed loaded (it reports 160px until its trace arrives) and then grew to
its content, e.g. 188px for a short program. It now starts at 190px, and
with large at the visualizer's requested height, and never gets smaller
than that; other blocks keep the 170px minimum.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cedricvogel-leo added a commit that referenced this pull request Oct 25, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cedricvogel-leo
cedricvogel-leo merged commit 5314d34 into main Oct 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant